<template>
  <div>
    <span v-for="(item,index) in arr" :key='item'><input type="checkbox" @click='btn(index)'/><span>{{item}}</span></span>
    <ul>
     <li  v-for= 'item in newArr' :key="item">{{item}}</li>
   </ul>
  </div>
  
</template>

<script>
export default {
data(){
  return {
// 数据
  arr:["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
  newArr:[],
  }
},
methods:{
  btn(index){
             !this.newArr.includes(this.arr[index]) ? this.newArr.push(this.arr[index]) : this.newArr.splice(index,1)
      }
}
}
</script>

<style>

</style>